//
//  DXLog.m
//  suremodv
//
//  Created by dd on 13-9-19.
//  Copyright (c) 2013年 xiaomuzhi. All rights reserved.
//

#import "DXLog.h"

@implementation DX (Log)

+ (void) i: (NSString *)format, ...
{
    DX *dx = [DX sharedInstance];
    
    if (format == nil) {
        return;
    }

    @try
    {
        // Get a reference to the arguments that follow the format parameter
        va_list argList;
        va_start(argList, format);
        // Perform format string argument substitution, reinstate %% escapes, then print
        NSMutableString *message = [[NSMutableString alloc] initWithFormat:format arguments:argList];
        [message replaceOccurrencesOfString:@"%%"
                                 withString:@"%%%%"
                                    options:0
                                      range:NSMakeRange(0, [message length])];
        if (dx.Debug) NSLog(@"%@", message);
        va_end(argList);
    }
    @catch (NSException *exception)
    {
        
    }
    @finally
    {
        
    }
}

@end
